/**
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package cn.edu.thu.laud.objectstore.fieldmanager;

import java.nio.ByteBuffer;

import org.apache.cassandra.thrift.Cassandra;
import cn.edu.thu.laud.utils.serde.ConverterContext;

/**
 * A collection that represents a relationship. All relations ships are
 * bi-directional even if not mapped as one this allows us to keep our relations
 * clean when the object on the non owned side is deleted. This cleanup happens
 * by loading all owners with the given ID and removing them.
 * 
 * @author zhuoan
 * 
 */
public class ExternalEntity {

	protected static final byte DELIM_MIN = 0;
	protected static final byte DELIM_MAX = 1;

	protected ConverterContext converterContext;

	protected String ownerColumnFamily;

	protected ByteBuffer ownerColumn;

	protected ByteBuffer rowKey;
	
	protected Cassandra.Client client;


	/**
	 * 
	 * @param context
	 *            The Byte converter context
	 * @param ownerColumnFamily
	 *            The owning column family
	 * @param rowKey
	 *            The row key
	 * @param ownerColumn
	 *            The bytes of the column
	 */
	public ExternalEntity(Cassandra.Client client, ConverterContext context,
			String ownerColumnFamily, ByteBuffer rowKey, ByteBuffer ownerColumn) {
		this.client = client;
		this.converterContext = context;
		this.ownerColumnFamily = ownerColumnFamily;
		this.ownerColumn = ownerColumn;
		this.rowKey = rowKey;
	}

	

}
